package service.clientsample;

import java.util.List;


import service.*;

public class ClientSample {

	public static void main(String[] args) {
	        System.out.println("***********************");
	        System.out.println("Create Web Service Client...");
	        CatalogsrService service1 = new CatalogsrService();
	        System.out.println("Create Web Service...");
	        Catalogsr catal = service1.getCatalogsrPort();
	        System.out.println("Call Web Service Operation...");
	        
	        Item i1= catal.create();
			i1.setName("foobar");
			i1.setDescription("foobar");
			i1.setPrice(100.50);
			catal.save(i1);
			Item i2= catal.create();
			i2.setName("barfoo");
			i2.setDescription("foobar");
			i2.setPrice(200.50);
			catal.save(i2);
			Item i3= catal.create();
			i3.setName("barbaz");
			i3.setDescription("foobar");
			i3.setPrice(300.50);
			catal.save(i3);
			Item i4= catal.create();
			i4.setName("zoobar");
			i4.setDescription("foobar");
			i4.setPrice(400.50);
			catal.save(i4);
			
			List<Item> items = catal.getItems(1,3);
			if (items != null) {
				for (Item item : items) {
					System.out.println("item " + item.getName());
					
				}
			} else {
				System.out.println("Aucun item");
			}		

	        
	       
	
	        System.out.println("***********************");
	        System.out.println("Call Over!");
	}
}
